﻿<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction Id="MyRibbonCustomization" Location="CommandUI.Ribbon">
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition Location="Ribbon.WebPartPage.Groups._children">
          <Group Id="Ribbon.WebPartPage.MyRibbonWebPart"
                 Sequence="20"
                 Description="Custom ribbon group"
                 Title="Ribbon Addition"
                 Template="Ribbon.Templates.Flexible2">
            <Controls Id="Ribbon.WebPartPage.MyRibbonWebPart.Controls">
              <Button Id="Ribbon.WebPartPage.MyRibbonWebPart.DemoButton"
                      Command="demoAction"
                      Description="a demo action"
                      Image16by16="/_layouts/images/edit.gif"
                      Image32by32="/_layouts/images/placeholder32x32.png"
                      LabelText="Demo Action"
                      TemplateAlias="o2"
                      Sequence="10" />
              <Button Id="Ribbon.WebPartPage.MyRibbonWebPart.DemoButton2"
                      Command="demoAction"
                      Description="a demo action"
                      Image16by16="/_layouts/images/edit.gif"
                      Image32by32="/_layouts/images/placeholder32x32.png"
                      LabelText="Demo Action2"
                      TemplateAlias="o2"
                      Sequence="10" />
            </Controls>
          </Group>
        </CommandUIDefinition>
        
        
        <!-- Here comes another custom action -->
        <CommandUIDefinition
                Location="Ribbon.WebPartPage.Scaling._children">
          <MaxSize Id="Ribbon.WebPartPage.MyRibbonWebPart.MaxSize"
                   Sequence="20"
                   GroupId="Ribbon.WebPartPage.MyRibbonWebPart"
                   Size="LargeLarge" />
        </CommandUIDefinition>
        <CommandUIDefinition
              Location="Ribbon.WebPartPage.Scaling._children">
          <Scale Id="Ribbon.WebPartPage.MyRibbonWebPart.MediumMedium"
                 Sequence="30"
                 GroupId="Ribbon.WebPartPage.MyRibbonWebPart"
                 Size="MediumMedium" />
        </CommandUIDefinition>
        <CommandUIDefinition
              Location="Ribbon.WebPartPage.Scaling._children">
          <Scale Id="Ribbon.WebPartPage.MyRibbonWebPart.Popup"
                 Sequence="50"
                 GroupId="Ribbon.WebPartPage.MyRibbonWebPart"
                 Size="Popup" />
        </CommandUIDefinition>

      </CommandUIDefinitions>

      <!-- Here comes the UI handler -->
      <CommandUIHandlers>
        <CommandUIHandler Command="demoAction"
                          CommandAction="javascript:alert('hello');" />
      </CommandUIHandlers>

    </CommandUIExtension>

  </CustomAction>
</Elements>
